<template>
    <z-form url="/api/contract/addContract" :fields="fields" :beforeSubmit="beforeSubmit" :closable="false" />
</template>

<script>
export default {
    data() {
        return {
            fields: [
                "title", "categoryId", "templateId", "party", "inorout", "performParty", "total", "currency", "related", "effective", "end", "rules", "head", "explain"
            ],
        };
    },
    created() { },
    methods: {
        beforeSubmit(formData) {
            if (!formData.templateId) {
                $.fail('请选择合同模版')
                return false
            } else if (!formData.rules) {
                $.fail('请选择编号规则')
                return false
            }
        }
    }
};
</script>
